C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]| Using C language| C Program series 36|
👨💻C Program to print Pyramid Pattern (▲) using two symbols (like '*' and 'A') for n number of lines.[Pattern:15]
Code :
For n number of LINES:
/*
C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]
For Example:n=5
*
*A*
*A*A*
*A*A*A*
*A*A*A*A*
*/
#include <stdio.h>
main()
{
int i,j,k,n,temp;
printf("C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]\n\n");
printf("Enter the number:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
temp=n;
for(j=temp-i;j>0;j--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("*");
if(j<i)
{
printf("A");
}
}
printf("\n");
}
}
The output of Code:
![C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3q7jj5AqwQH68ywlKnU0xj1xX_75QVY-Kqq_kUT2Ox1ot8VIsElqqPIRVm5-IFlRde4f7PCvfvRe1abySXhT1Lz9xBgzBFRM2rE-QzYnFOZEaFxGovcBLw2oiVXg8QTXDzv48EUmztqCmsd5bh3qrQXu50PwrSi_J49YB3xQpRo4LbRk4bL-tMU0/w640-h126/Screenshot%202022-11-04%20210640.jpg)
![C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuhqquDS-GHADmBjRn7A1mBgvQLYw1F7TwFCP9ebuLh3Xtubz5LUtl5RtOJuBEe8yPHEjvFad3vUluBZIyhff62qPVRf1KCPUUkC72NdbIeVfnvghz0hhfMHgJjMLzvLW8TneV2xl1YcKCAmERGVR3Il04FbH1lo37oPtedc4q68oS0DWI8LRmN0k/w640-h176/Screenshot%202022-11-04%20210700.jpg)
![C Program to print Pyramid Pattern using two symbols (like '*' and 'A') for n number of lines.[Pattern 15]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQSS-aneTO0Fa26IZvkJqgN75cb01ZpMI-PhlETlgVIeJIPjoSuMu4ljFm5xcCNNyHDePXCQDNqOmnFkIYC-4f4abG44n4vfscv03HteDkcYLO1j9zknKdVhGe8UDkXmIkEgQDw-YhsahgH9WwtKxUQitE1Oyc3sqnSRj2i-_6WCZ69WYf0rwtPBk/w640-h292/Screenshot%202022-11-04%20210721.jpg)
Comments
Post a Comment